package com.huatec.controller;

import com.huatec.service.TeacherService;
import com.huatec.util.Result;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/teacher")
public class TeacherController {
    @Resource
    private TeacherService teacherService;
    //按 teacherId查询教师信息
    @RequestMapping(value="/{teacherId}",method= RequestMethod.GET)
    @ResponseBody
    public Result getTeacherInfo(@PathVariable("teacherId") int teacherId){

        Result result=teacherService.getTeacherInfo(teacherId);
        return result;
    }
}
